'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH SCF_ERROR 3SCF "February 21, 2023"
.SH NAME
scf_error, scf_strerror \- error interface to Service Configuration Facility
.SH SYNOPSIS
.nf
cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lscf\fR [ \fIlibrary\fR\&.\|.\|. ]
#include <libscf.h>

\fBscf_error_t\fR \fBscf_error\fR(\fBvoid\fR);
.fi

.LP
.nf
\fBconst char *\fR\fBscf_strerror\fR(\fBscf_error_t\fR \fIerror\fR);
.fi

.SH DESCRIPTION
The \fBscf_error()\fR function returns the current \fBlibscf\fR(3LIB) error
value for the current thread. If the immediately previous call to a
\fBlibscf\fR function failed, the error value will reflect the reason for that
failure.
.sp
.LP
The \fBscf_strerror()\fR function takes an error code previously returned by
\fBscf_error()\fR and returns a human-readable, localized description of the
error.
.sp
.LP
The error values are as follows:
.sp
.ne 2
.na
\fB\fBSCF_ERROR_BACKEND_ACCESS\fR\fR
.ad
.sp .6
.RS 4n
The storage mechanism that the repository server (\fBsvc.configd\fR(8)) chose
for the operation denied access.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_BACKEND_READONLY\fR\fR
.ad
.sp .6
.RS 4n
The storage mechanism that the repository server (\fBsvc.configd\fR) chose for
the operation is read-only. For the local filesystem storage mechanism
(currently \fB/etc/svc/repository.db\fR), this usually occurs because the
filesystem that contains it is mounted read-only. See \fBmount\fR(8)
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_CONNECTION_BROKEN\fR\fR
.ad
.sp .6
.RS 4n
The connection to repository is broken.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_CONSTRAINT_VIOLATED\fR\fR
.ad
.sp .6
.RS 4n
A required constraint was not met.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_DELETED\fR\fR
.ad
.sp .6
.RS 4n
Object was deleted.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_EXISTS\fR\fR
.ad
.sp .6
.RS 4n
The object already exists.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_HANDLE_DESTROYED\fR\fR
.ad
.sp .6
.RS 4n
An object was bound to a destroyed handle.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_HANDLE_MISMATCH\fR\fR
.ad
.sp .6
.RS 4n
Objects from different SCF handles were used.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_IN_USE\fR\fR
.ad
.sp .6
.RS 4n
The object is currently in use.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_INTERNAL\fR\fR
.ad
.sp .6
.RS 4n
An internal error occurred.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_INVALID_ARGUMENT\fR\fR
.ad
.sp .6
.RS 4n
An argument is invalid.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_NO_MEMORY\fR\fR
.ad
.sp .6
.RS 4n
No memory is available.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_NO_RESOURCES\fR\fR
.ad
.sp .6
.RS 4n
The repository server is out of resources.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_NO_SERVER\fR\fR
.ad
.sp .6
.RS 4n
The repository server is unavailable.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_NONE\fR\fR
.ad
.sp .6
.RS 4n
No error occurred.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_BOUND\fR\fR
.ad
.sp .6
.RS 4n
The handle is not bound.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_FOUND\fR\fR
.ad
.sp .6
.RS 4n
Nothing of that name was found.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_SET\fR\fR
.ad
.sp .6
.RS 4n
Cannot use unset value.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_PERMISSION_DENIED\fR\fR
.ad
.sp .6
.RS 4n
The user lacks sufficient authority to conduct the requested operation. See
\fBsmf_security\fR(7).
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_TYPE_MISMATCH\fR\fR
.ad
.sp .6
.RS 4n
The type does not match value.
.RE

.sp
.ne 2
.na
\fB\fBSCF_ERROR_VERSION_MISMATCH\fR\fR
.ad
.sp .6
.RS 4n
The SCF version is incompatible.
.RE

.SH RETURN VALUES
The \fBscf_error()\fR function returns \fBSCF_ERROR_NONE\fR if there have been
no calls from \fBlibscf\fR functions from the current thread. The return value
is undefined if the immediately previous call to a \fBlibscf\fR function did
not fail.
.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
_
MT-Level	MT-Safe
.TE

.SH SEE ALSO
.BR libscf (3LIB),
.BR attributes (7),
.BR svc.configd (8)
